<?php
namespace  app\php;
class Conn
{
    public  function aaaaaa()
    {
        $dbhost = 'localhost:3307';  // mysql服务器主机地址
        $dbuser = 'root';            // mysql用户名
        $dbpass = '';          // mysql用户名密码
        $conn = mysqli_connect($dbhost, $dbuser, $dbpass);
        if (!$conn) {
            die('连接失败: ' . mysqli_error($conn));
        }

        echo "连接成功\n";
// 设置编码，防止中文乱码
        mysqli_query($conn, "set names utf8");
        mysqli_select_db($conn, 'RUNOOB');
        return $conn;
    }
}